<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <!-- 根容器 -->
  <div id="app">
    <router-view></router-view>
  </div>
  <script src="./vue.js"></script>
  <script src="./vue-router.min.js"></script>
  <script>
    const router = new VueRouter({ 
      // routes 指定路由规则数组
      routes:[
        // 匹配 / 路径，重定向 到 '/home' 即可
        {
          path: '/', redirect: '/home'
        },
        // 首页路由规则
        {
          path: '/home',
          component: {
            template: '<div>首页页面内容</div>'
          }
        }
      ] 
    })
    new Vue({
      el: '#app',
      router
    })
  </script>
</body>
</html>